package com.naiterui.ehp.bs.ds.modules.goods.controller;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.naiterui.ehp.bp.constants.SwaggerTag;
import com.naiterui.ehp.bp.security.annotation.SysLog;
import com.naiterui.ehp.bs.ds.modules.goods.service.IWarehouseService;
import com.naiterui.ehp.bs.ds.modules.goods.vo.WarehouseVO;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;

@Slf4j
@Api(tags = {SwaggerTag.DS + SwaggerTag.PHARMACY})
@RestController
@AllArgsConstructor
@RequestMapping("warehouse")
public class WarehouseController {

    private final IWarehouseService warehouseService;

    @SysLog("商家信息")
    @GetMapping
    @ApiOperation("商家信息")
    @ApiImplicitParams({
        @ApiImplicitParam(name = "id", value = "商家ID", dataType = "int", paramType = "path", required = true),
    })
    @PreAuthorize("@p.check('warehouse:info')")
    public WarehouseVO get() {
        log.info("获取商家信息");
        return this.warehouseService.getWarehouse();
    }

}
